<template>
  <div class="list">
    <div class="box">
    <div class="header clear">
      <div class="item-text">
        共收藏企业数量<span class="sc">165</span>个
      </div>
      <div class="segment">|</div>
      <div class="item-text">
        最近联系<span class="zj">10</span>个
      </div>
      <div class="item right">
        <el-button type="primary">新增企业</el-button>
        <el-button type="primary">取消收藏</el-button>
        <el-button type="primary">批量处理标签</el-button>
        <el-button type="primary">批量导入企业</el-button>
      </div>
    </div>
    <div class="condition">
      <div class="item">
        企业名称：
        <el-input
          placeholder="请输入企业全称"
          v-model="condition.companyName"
        />
      </div>
      <div class="item">
        所在地区：
        <el-select
          v-model="condition.region"
          placeholder="请选择地区"
        >
          <el-option
            :value="-1"
            label="所有地图"
          />
          <el-option
            v-for="item in regions"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </div>
      <div class="item">
        企业标签：
        <el-select
          v-model="condition.companyTag"
          placeholder="请选择行业"
        >
          <el-option
            :value="-1"
            label="所有行业"
          />
        </el-select>
      </div>
      <div class="item zczb">
        注册资本：
        <input-number
          :suffix="true"
          v-model="condition.regMoney"
          :min="1"
          :max="99999"
          suffixText="万元"
        />
      </div>
      <div class="item">
        注册日期：
        <el-date-picker
          style="width:200px"
          v-model="condition.regDate"
          type="daterange"
          range-separator="-"
          start-placeholder=""
          end-placeholder=""
        >
        </el-date-picker>

      </div>
      <div class="item">
        <el-button type="primary">搜索</el-button>
        <el-button>重置</el-button>
      </div>
    </div>
    </div>
    <div class="list-view box">
      <el-table
      class="list-table"
        :data="tableData"
        style="width: 100%"
      >
        <el-table-column
          prop="tel"
          label="电话"
          width="180"
        >
        <template slot-scope="{row}" >
          <el-button icon="el-icon-phone"  type="success" circle @click="alert(row.id)"></el-button>
        </template>
        </el-table-column>
        <el-table-column
          prop="companyName"
          label="企业名称"
          width="180"
        >
        </el-table-column>
        <el-table-column
          prop="sc_date"
          label="收藏时间"
        >
        </el-table-column>
        <el-table-column
          prop="address"
          label="所属地区"
        >
        </el-table-column>
        <el-table-column
          prop="zczb"
          label="注册资本"
        >
        </el-table-column>
        <el-table-column
          prop="zcrq"
          label="注册日期"
        >
        </el-table-column>
        <el-table-column
          prop="id"
          label="企业信息"
        >
        <template slot-scope="{row}">
          <a @click="detail(row.id)">查看 详情</a>
        </template>
        </el-table-column>
        <el-table-column label="自定义标签">
          <template slot-scope="{row}">
            {{row.tag}}
          </template>
        </el-table-column>
        <el-table-column label="备注" prop="desc">

        </el-table-column>
      </el-table>
          <page
      :total="total"
      :current.sync="condition.page"
      :size.sync="condition.size"
      @change="search"
    />
    </div>
  </div>
</template>

<script>
import { fetchRegion } from "@/api";
import inputNumber from "@/components/form/section/inputNumber";
import Page from "@/components/list/page"
export default {
  components: {
    inputNumber,
    Page
  },
  data() {
    return {
      total:100,
      regions: [],
      tableData:[],
      loading:true,
      condition: {
        page:1,
        size:10,
        companyname: "",
        region: null,
        companyTag: null,
        regMoney: [1, 2],
        regDate: []
      }
    };
  },
  created() {
    this.getRegion();
  },
  methods: {
    getRegion() {
      fetchRegion(101, res => {
        if (res.code === 1) {
          this.regions = res.data.region;
        }
      });
    },
    search(){
    }
  }
};
</script>

<style lang="scss" scoped>
@import "@/styles/user/index";

</style>
